package com.jackrain.nea;

import com.jackrain.nea.core.db.DynamicDataSourceRegister;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Import;

@SuppressWarnings("ALL")
@SpringBootApplication
@Import({ModelConfig.class,DynamicDataSourceRegister.class})
//public class Application {
//
//    public static void main(String[] args) {
//        System.setProperty("spring.devtools.restart.enabled","false");
//        ApplicationContext applicationContext = SpringApplication.run(Application.class, args);
//    }
//}

public class PrimWebApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        System.setProperty("spring.devtools.restart.enabled","false");
        SpringApplication.run(applicationClass, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(applicationClass);
    }

    private static Class<PrimWebApplication> applicationClass = PrimWebApplication.class;
}